From: Iain Lane Date: Thu, 2 May 2019 09:49:12 +0000 (+0100) Subject: main, LoginManager: Call GDM's RegisterSession() X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~845^2^2~139 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0e37cd2ec92c5fbbc0870272e5e00fc07a705eba;p=gnome-shell.git main, LoginManager: Call GDM's RegisterSession() So that it can know if we started up properly and use that to (e.g.) kill its greeter. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/570 --- diff --git a/js/misc/loginManager.js b/js/misc/loginManager.js index f615b4f99..4f4cc836f 100644 --- a/js/misc/loginManager.js +++ b/js/misc/loginManager.js @@ -48,6 +48,28 @@ function canLock() { } } + +function registerSessionWithGDM() { + log("Registering session with GDM"); + Gio.DBus.system.call('org.gnome.DisplayManager', + '/org/gnome/DisplayManager/Manager', + 'org.gnome.DisplayManager.Manager', + 'RegisterSession', + GLib.Variant.new('(a{sv})', [{}]), null, + Gio.DBusCallFlags.NONE, -1, null, + (source, result) => { + try { + source.call_finish(result); + } catch (e) { + if (!e.matches(Gio.DBusError, Gio.DBusError.UNKNOWN_METHOD)) + log(`Error registering session with GDM: ${e.message}`); + else + log("Not calling RegisterSession(): method not exported, GDM too old?"); + } + } + ); +} + let _loginManager = null; /** diff --git a/js/ui/main.js b/js/ui/main.js index 5f789e996..70c550cc5 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -250,6 +250,8 @@ function _initializeUI() { }); } + LoginManager.registerSessionWithGDM(); + let perfModuleName = GLib.getenv("SHELL_PERF_MODULE"); if (perfModuleName) { let perfOutput = GLib.getenv("SHELL_PERF_OUTPUT");